package com.oocl.Homework3;

import java.util.TreeSet;

public class Test 
{
	public static void printSet(TreeSet<Customer> set)
	{
		FormatPrint fp=new FormatPrint();
		for(Customer customer : set)
			fp.print(customer);
             
	}
	public static void printSetXml(TreeSet<Customer> set)
	{
		FormatPrint fp=new FormatPrint();
		System.out.println("<customer>");
		for(Customer customer : set)
			fp.printXml(customer);
		System.out.println("</customer>");
	}
	public static void main(String[] args) 
	{
		ReadFile rf=new ReadFile();
		rf.read();
		
		System.out.println("Sort by Id: ");
		printSet(rf.set1);
		
		System.out.println("");
		System.out.println("Sort by Date: ");
		rf.SortByDate();
		printSet(rf.set2);
		
		printSetXml(rf.set1);
		printSetXml(rf.set2);
	}
}
